SELECT GET_EMPLOYEENAME('A12345') FROM DUAL;
CREATE OR REPLACE FUNCTION GET_EMPLOYEENAME(
IN_EMPLOYEEID IN VACHAR2
)
RETURN VACHAR2
IS
V_NAME VACHAR2(20);
BEGIN
SELECT EMPLOYEES.NAME
INTO V_NAME
FROM EMPLOYEES
WHERE EMPLOYEES.ID = IN_EMPLOYEEID;
RETURN V_NAME
END GET_EMPLOYEENAME;
EXECUTE DELETE_EMPLOYEENAME('A12345');
CREATE OR REPLACE PROCEDURE DELETE_EMPLOYEENAME (
IN_EMPLOYEEID IN VACHAR2
)
IS
BEGIN
DELETE FROM EMPLOYEES
WHERE EMPLOYEES.ID = IN_EMPLOYEEID;
COMMIT;
END;